package com.itheima.springbootmybatis1.mapper;

import com.itheima.springbootmybatis1.domian.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author:zhq
 * @Date: 2025/07/08 11:36
 * @Description:
 */
@Mapper
public interface UserMapper {
    /*@Select("select * from user")
    public List<User> findAll();

    @Delete("delete from user where id=${id}")
    int deleteByUser(int id);

    @Delete("delete from user where id=2")
    int deleteByUser1();

    @Delete("delete from user where id=#{id}")
    boolean deleteByUser2(int id);

    @Options(useGeneratedKeys = true,keyProperty = "id")
    @Insert("insert into user (username, password, name, age) values (#{username},#{password},#{name},#{age})")
    int insertByUser(User user);

    @Update("update user set username=#{username},password=#{username},age=#{age} where id=#{id}")
    boolean updateById(User user);*/


    User selectByUserNameandPassword(@Param("username") String username,@Param("password") String password);

    List<User> findAll();
    boolean updateByName(User name);

}
